/*
archer
study 2 analyses 
*/

* load "study2.dta"

set scheme s1mono

// key IVs
* treatments
tab fncvstrump_do

gen control=.
replace control=1 if fncvstrump_do=="FNC_cont|Q119"
tab control

gen trumpattack=.
replace trumpattack=1 if fncvstrump_do=="fnc|Q119"
tab trumpattack

gen oann=.
replace oann=1 if fncvstrump_do=="oann|Q119"
tab oann

gen defense=.
replace defense=1 if fncvstrump_do=="defense|Q119"
tab defense


gen treatments=.
replace treatments=1 if control==1
replace treatments=2 if trumpattack==1
replace treatments=3 if oann==1
replace treatments=4 if defense==1
tab treatments

drop if treatments==. //drop those who didn't have treatment
tab treatments

gen treatments2=.
replace treatments2=1 if control==1
replace treatments2=2 if trumpattack==1
replace treatments2=3 if oann==1|defense==1
tab treatments2

* treatments for reg
gen DTattack=0
replace DTattack=1 if trumpattack==1
tab DTattack

gen DTattack_oann=0
replace DTattack_oann=1 if oann==1
tab DTattack_oann

gen DTattack_def=0
replace DTattack_def=1 if defense==1
tab DTattack_def

gen DTattack_oann_def=0
replace DTattack_oann_def=1 if oann==1|defense==1
tab DTattack_oann_def

// demographics
* PID
gen pid7=.
replace pid7=1 if dem==1
replace pid7=2 if dem==2
replace pid7=3 if ind==1
replace pid7=4 if ind==3|ind==4
replace pid7=5 if ind==2
replace pid7=6 if rep==2
replace pid7=7 if rep==1
tab pid7

recode pid7 (1 2 3 = 1 "Democrat")(5 6 7 = 0 "Republican")(else=.), gen(demgop)
tab demgop

* age
tab age
tab age_lucid

gen age01=(age_lucid-18)/(97-18)
tab age01

* sex
tab sex
recode sex (1=0 "Male")(2=1 "Female")(else=.), gen(female)
tab female

* race
tab race
recode race (5=0 "white")(1=1 "black")(3=2 "Hispanic")(2=3 "Asian")(else=.), gen(race4cat)
recode race4cat (1=1)(0 2 3=0)(else=.), gen(black) 
tab black
recode race4cat (2=1)(0 1 3=0)(else=.), gen(hisp) 
tab hisp
recode race4cat (3=1)(0 1 2=0)(else=.), gen(asian)
tab asian
recode race (1 2 3 4 6=1 "nonwhite")(5=0 "white")(else=.), gen(nonwhite)
tab nonwhite

gen native_amer=.
replace native_amer=1 if race==4
replace native_amer=0 if race!=4
tab native_amer 

gen white=. 
replace white=1 if race==5
replace white=0 if race!=5
tab white 

gen otherrace=.
replace otherrace=1 if race==6
replace otherrace=0 if race!=6
tab otherrace

* edu
tab edu
recode edu (1 2=0 "less HS")(3=.25)(4 5=.5)(6=.75)(7=1 "post BA")(else=.), gen(ed5cat)
tab ed5cat

gen college=0
replace college=1 if edu==5|edu==6|edu==7
tab college

* news interest
tab newsint
recode newsint(1=1 "Most of the time")(2=.6666)(3=.3333)(4=0 "Hardly at all")(else=.), gen(newsint01)
tab newsint01

* employ
tab employ 
recode employ (1 2 4 5 6 7 8 9=0)(3=1)(else=.), gen(unemployed)
tab unemployed

by treatments2, sort: summarize pid7 ed5cat black hisp asian native_amer white otherrace age_lucid female state unemployed favdt favjb newsint  

// DVs 
* consumption
tab consumefox
recode consumefox (1=4 "Extremely likely")(2=3 "Very likely")(3=2 "Somewhat likely")(4=1 "Not very likely")(5=0 "Not at all likely")(else=.), gen(consumefoxb)
tab consumefoxb
gen consumefox01=consumefoxb/4
tab consumefox01

tab consumeoann
recode consumeoann (1=4 "Extremely likely")(2=3 "Very likely")(3=2 "Somewhat likely")(4=1 "Not very likely")(5=0 "Not at all likely")(else=.), gen(consumeoannb)
tab consumeoannb
gen consumeoann01=consumeoannb/4
tab consumeoann01

gen diffconsume=consumeoann01-consumefox01

* ideological bias
tab fncbias
recode fncbias (1=0 "Extremely liberal")(2=1 "Somewhat liberal")(3=2 "Neither")(4=3 "Somewhat conservative")(5=4 "Extremely conservative")(else=.), gen(foxconserv)
tab foxconserv

gen foxconserv01=(foxconserv)/4
tab foxconserv01

tab oannbias
recode oannbias (1=0 "Extremely liberal")(2=1 "Somewhat liberal")(3=2 "Neither")(4=3 "Somewhat conservative")(5=4 "Extremely conservative")(else=.), gen(oannconserv)
tab oannconserv

gen oannconserv01=(oannconserv)/4
tab oannconserv01

gen diffconserv=oannconserv01-foxconserv01

* fair to trump
tab foxfair
recode foxfair (1=4 "Strongly agree")(2=3 "Somewhat agree")(3=2 "Neither")(4=1 "Somewhat disagree")(5=0 "Strongly disagree")(else=.), gen(foxfairb)
tab foxfairb

gen foxfair01=(foxfairb/4)
tab foxfair01

tab oannfair
recode oannfair (1=4 "Strongly agree")(2=3 "Somewhat agree")(3=2 "Neither")(4=1 "Somewhat disagree")(5=0 "Strongly disagree")(else=.), gen(oannfairb)
tab oannfairb

gen oannfair01=(oannfairb/4)
tab oannfair01

gen difffair=oannfair01-foxfair01

* critical of trump 
tab foxcrit
recode foxcrit (1=4 "Extremely critical")(2=3 "Very critical")(3=2 "Somewhat critical")(4=1 "Not very critical")(5=0 "Not at all critical")(else=.), gen(foxcritb)
tab foxcritb

gen foxcrit01=(foxcritb/4)
tab foxcrit01

tab oanncrit
recode oanncrit (1=4 "Extremely critical")(2=3 "Very critical")(3=2 "Somewhat critical")(4=1 "Not very critical")(5=0 "Not at all critical")(else=.), gen(oanncritb)
tab oanncritb

gen oanncrit01=(oanncritb/4)
tab oanncrit01

gen diffcrit=oanncrit01-foxcrit01


********** analyses **********

mlogit treatments2 pid7 age01 newsint01 female nonwhite college unemployed 

// consumption 

by treatments2, sort: summarize consumefox01
by treatments2, sort: summarize consumefox01 if demgop==0
by treatments2, sort: summarize consumefox01 if demgop==1

by treatments2, sort: summarize consumeoann01
by treatments2, sort: summarize consumeoann01 if demgop==0
by treatments2, sort: summarize consumeoann01 if demgop==1

* table 3 
reg diffconsume DTattack DTattack_oann_def if demgop==0
lincom DTattack+ _cons
lincom DTattack_oann_def+ _cons
reg diffconsume DTattack DTattack_oann_def if demgop==1
lincom DTattack+ _cons
lincom DTattack_oann_def+ _cons

reg consumefox01 DTattack DTattack_oann_def if demgop==0
reg consumefox01 DTattack DTattack_oann_def if demgop==1

reg consumeoann01 DTattack DTattack_oann_def if demgop==0
lincom DTattack-DTattack_oann_def
reg consumeoann01 DTattack DTattack_oann_def if demgop==1


********** appendix  **********

* differences scores between OANN and FNC: all coded as OANN minus FNC

tab diffcrit
tab diffconserv
tab diffconsume

by treatments2, sort: summarize diffcrit diffconserv diffconsume 
by treatments2, sort: summarize diffcrit diffconserv diffconsume if demgop==0
by treatments2, sort: summarize diffcrit diffconserv diffconsume if demgop==1

reg diffcrit DTattack DTattack_oann_def if demgop==0
lincom DTattack+ _cons
lincom DTattack_oann_def+ _cons
reg diffcrit DTattack DTattack_oann_def if demgop==1
lincom DTattack+ _cons
lincom DTattack_oann_def+ _cons

reg diffconserv DTattack DTattack_oann_def if demgop==0
lincom DTattack+ _cons
lincom DTattack_oann_def+ _cons
reg diffconserv DTattack DTattack_oann_def if demgop==1
lincom DTattack+ _cons
lincom DTattack_oann_def+ _cons

* bias DVs 
reg foxcrit01 DTattack DTattack_oann_def if demgop==0
reg foxcrit01 DTattack DTattack_oann_def if demgop==1

reg oanncrit01 DTattack DTattack_oann_def if demgop==0
reg oanncrit01 DTattack DTattack_oann_def if demgop==1

reg foxconserv01 DTattack DTattack_oann_def if demgop==0
reg foxconserv01 DTattack DTattack_oann_def if demgop==1

reg oannconserv01 DTattack DTattack_oann_def if demgop==0
reg oannconserv01 DTattack DTattack_oann_def if demgop==1


* OANN and Defense conditions separate (need to control for nonwhite here)

tab diffconsume
reg diffconsume DTattack DTattack_oann DTattack_def nonwhite if demgop==0
lincom DTattack_oann-DTattack_def
reg diffconsume DTattack DTattack_oann DTattack_def nonwhite if demgop==1
lincom DTattack_oann-DTattack_def

reg consumefox01 DTattack DTattack_oann DTattack_def nonwhite if demgop==0
lincom DTattack_oann-DTattack_def
reg consumefox01 DTattack DTattack_oann DTattack_def nonwhite if demgop==1
lincom DTattack_oann-DTattack_def

reg consumeoann01 DTattack DTattack_oann DTattack_def nonwhite if demgop==0
lincom DTattack_oann-DTattack_def
reg consumeoann01 DTattack DTattack_oann DTattack_def nonwhite if demgop==1
lincom DTattack_oann-DTattack_def


tab diffcrit
reg diffcrit DTattack DTattack_oann DTattack_def nonwhite if demgop==0
lincom DTattack_oann-DTattack_def
reg diffcrit DTattack DTattack_oann DTattack_def nonwhite if demgop==1
lincom DTattack_oann-DTattack_def

tab diffconserv
reg diffconserv DTattack DTattack_oann DTattack_def nonwhite if demgop==0
lincom DTattack_oann-DTattack_def
reg diffconserv DTattack DTattack_oann DTattack_def nonwhite if demgop==1
lincom DTattack_oann-DTattack_def

tab difffair
reg difffair DTattack DTattack_oann DTattack_def nonwhite if demgop==0
lincom DTattack_oann-DTattack_def 
reg difffair DTattack DTattack_oann DTattack_def nonwhite if demgop==1
lincom DTattack_oann-DTattack_def 

* fairness DV
reg difffair DTattack DTattack_oann_def if demgop==0
reg difffair DTattack DTattack_oann_def if demgop==1


* study order
tab fl_34_do

gen KHfirst=.
replace KHfirst=1 if fl_34_do=="FL_81|FL_82" 
replace KHfirst=0 if fl_34_do=="FL_82|FL_81" 
tab KHfirst

gen KHfirstXattack=KHfirst*DTattack
gen KHfirstXoann=KHfirst*DTattack_oann_def

reg diffconsume DTattack KHfirstXattack DTattack_oann_def KHfirstXoann KHfirst if demgop==0
reg diffconsume DTattack KHfirstXattack DTattack_oann_def KHfirstXoann KHfirst if demgop==1

reg diffcrit DTattack KHfirstXattack DTattack_oann_def KHfirstXoann KHfirst if demgop==0
reg diffcrit DTattack KHfirstXattack DTattack_oann_def KHfirstXoann KHfirst if demgop==1

reg diffconserv DTattack KHfirstXattack DTattack_oann_def KHfirstXoann KHfirst if demgop==0
reg diffconserv DTattack KHfirstXattack DTattack_oann_def KHfirstXoann KHfirst if demgop==1 

